<?php

/**
 * 文件分类验证器
 */

namespace app\common\validate;

class AttachmentCateValidate extends Validate
{
        protected $rule = [
                'name|名称' => 'require',
                'parent_id|父级id' => 'require',
                'level|等级' => 'require',
                'sort|排序' => 'require',

        ];

        protected $message = [
                'name.require' => '名称不能为空',
                'parent_id.require' => '父级id不能为空',
                'level.require' => '等级不能为空',
                'sort.require' => '排序不能为空',

        ];

        protected $scene = [
                'add'  => ['name', 'parent_id', 'sort',],
                'edit' => ['name', 'parent_id'],

        ];
}
